using System;
using System.Data.Entity.ModelConfiguration;
using System.Data.Common;
using System.Data.Entity;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using DomainLayer.Data.Entities;

namespace Infrastructure.Data.Mapping
{
	public class NoticeMap : EntityTypeConfiguration<Notice>
	{
		public NoticeMap()
		{
			// Primary Key
			this.HasKey(t => t.id);

			// Properties
			this.Property(t => t.Title)
				.HasMaxLength(20);
				
			this.Property(t => t.Signature)
				.HasMaxLength(10);
				
			// Table & Column Mappings
			this.ToTable("Notice");
			this.Property(t => t.id).HasColumnName("id");
			this.Property(t => t.Title).HasColumnName("Title");
			this.Property(t => t.NoitceContent).HasColumnName("NoitceContent");
			this.Property(t => t.Signature).HasColumnName("Signature");
			this.Property(t => t.CreateBy).HasColumnName("CreateBy");
			this.Property(t => t.CreateTime).HasColumnName("CreateTime");
			this.Property(t => t.UpdateBy).HasColumnName("UpdateBy");
			this.Property(t => t.UpdateTime).HasColumnName("UpdateTime");
			this.Property(t => t.IsDelete).HasColumnName("IsDelete");
		}
	}
}

